import { type NavList } from '../types/home.d'

const userNavList: NavList = [
  {
    path: '/farm',
    icon: 'iconfont icon-jiejuefangan-yongdiyangdi',
    text: '农业助手',
    children: [
      {
        path: '/plantingSchemes',
        icon: 'iconfont icon-zhibo',
        text: '种植方案',
      },
      {
        path: '/expertHelp',
        icon: 'iconfont icon-nongyezhuanjia',
        text: '专家帮扶',
      },
      {
        path: '/liveBroadCast',
        icon: 'iconfont icon-zhibo',
        text: '农产品直播',
      },
    ],
  },
  {
    path: '/warn',
    icon: 'iconfont icon-ziranzaihai',
    text: '灾害预警',
    children: [
      {
        path: '/flood',
        icon: 'iconfont icon-hongshuiwei',
        text: '洪水',
      },
      {
        path: '/mudslide',
        icon: 'iconfont icon-nishiliu',
        text: '泥石流',
      },
      {
        path: '/fire',
        icon: 'iconfont icon-huozai',
        text: '火灾',
      },
      {
        path: '/earthquake',
        icon: 'iconfont icon-icon-test',
        text: '地震',
      },
    ],
  },
  {
    path: '/law',
    icon: 'iconfont icon-ai',
    text: '法律助手',
    children: [
      {
        path: '/farmer',
        icon: 'iconfont icon-nongmingongzuo',
        text: 'AI小助手',
      },
      {
        path: '/civilProcedure',
        icon: 'iconfont icon-juece',
        text: '民事诉讼',
      },
    ],
  },
]

const adminNavList: NavList = [
  { path: '/back/user', icon: 'iconfont icon-user', text: '用户管理' },
  { path: '/back/meeting', icon: 'iconfont icon-meeting', text: '会议管理' },
  { path: '/back/badwords', icon: 'iconfont icon-error', text: '违禁词管理' },
  { path: '/back/forum', icon: 'iconfont icon-forum', text: '论坛管理' },
]

export const getNavList = (identity: number): NavList => {
  if (identity === 1) return userNavList
  else if (identity === 2) return adminNavList
  else return []
}
